package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication {
	// 解决请求参数个数超过10000的tomcat默认配置
	@Bean
	public TomcatServletWebServerFactory mbeddedServletContainerFactory() {
		TomcatServletWebServerFactory tomcatEmbeddedServletContainerFactory = new TomcatServletWebServerFactory();

		tomcatEmbeddedServletContainerFactory.addConnectorCustomizers(connector -> {
			connector.setMaxParameterCount(2000000);
		});

		return tomcatEmbeddedServletContainerFactory;
	}

	public static void main(String[] args) {
		// System.setProperty("spring.devtools.restart.enabled", "false");
		SpringApplication.run(RuoYiApplication.class, args);
		System.out.println("rate_lzjy started successfully...");
	}
}